extends menu

block market_view
  .row
    .col-md-12  
      .panel.panel-default
        .panel-heading
          strong #{settings.locale.yobit} - #{marketdata.coin}/#{marketdata.exchange} - #{settings.locale.mkt_hours}
          a(href='#')
            span.fa.fa-line-chart.pull-right.view-chart-disabled.iquidus.market-toggle(data-toggle='tooltip', data-placement='bottom', title='#{settings.locale.mkt_no_chart}') 
        table.table.table-bordered.summary-table 
          thead
            tr
              th #{settings.locale.mkt_high}
              th #{settings.locale.mkt_low}
              th.hidden-xs #{settings.locale.mkt_top_bid}
              th.hidden-xs #{settings.locale.mkt_top_ask}
              th.hidden-xs #{settings.locale.mkt_last}
          tbody
            tr
              td #{marketdata.data.summary.high}
              td #{marketdata.data.summary.low}
              td.hidden-xs #{marketdata.data.summary.buy}
              td.hidden-xs #{marketdata.data.summary.sell}
              td.hidden-xs #{marketdata.data.summary.last}
  .row
    .col-md-6.col-xs-12
      .panel.panel-default
        .panel-heading
          h3.panel-title #{settings.locale.mkt_buy_orders}
        table.table.table-striped.table-bordered.order-table
          thead
            tr
              th #{settings.locale.mkt_price} (#{marketdata.exchange})
              th #{settings.locale.mkt_amount} (#{marketdata.coin})
              th.hidden-xs #{settings.locale.mkt_total} (#{marketdata.exchange})
          tbody
            each buy in marketdata.data.buys
              tr
                td
                  =buy[0].toFixed(8)
                td
                  =buy[1].toFixed(8)
                td.hidden-xs
                  - var total = buy[0] * buy[1];
                  =total.toFixed(8)
    .col-md-6.col-xs-12
      .panel.panel-default
        .panel-heading
          h3.panel-title #{settings.locale.mkt_sell_orders}
        table.table.table-striped.table-bordered.order-table
          thead
            tr
              th #{settings.locale.mkt_price} (#{marketdata.exchange})
              th #{settings.locale.mkt_amount} (#{marketdata.coin})
              th.hidden-xs #{settings.locale.mkt_total} (#{marketdata.exchange})
          tbody
            each sell in marketdata.data.sells
              tr
                td
                  =sell[0].toFixed(8)
                td
                  =sell[1].toFixed(8)
                td.hidden-xs
                  - var total = sell[0] * sell[1];
                  =total.toFixed(8)
  .row   
    .col-md-12
      .panel.panel-default
        .panel-heading
          h3.panel-title #{settings.locale.mkt_trade_history}
        table.table.table-hover.history-table.table-bordered(cellspacing="0")
          thead
            tr
              th.hidden-xs #{settings.locale.mkt_type}
              th #{settings.locale.mkt_amount} (#{marketdata.coin})
              th #{settings.locale.mkt_price} (#{marketdata.exchange})
              th #{settings.locale.mkt_total} (#{marketdata.exchange})
              th.hidden-xs #{settings.locale.mkt_time_stamp}
          tbody
            each order in marketdata.data.history
              if order.type == 'bid'
                tr.success
                  td.hidden-xs
                    =order.type
                  td
                    =order.amount.toFixed(8)
                  td
                    =order.price.toFixed(8)
                  td
                    - var total = order.amount * order.price;
                    =total.toFixed(8)
                  td.hidden-xs
                    =format_unixtime(order.timestamp)       
              else
                tr.danger 
                  td.hidden-xs
                    =order.type
                  td
                    =order.amount.toFixed(8)
                  td
                    =order.price.toFixed(8)
                  td
                    - var total = order.amount * order.price;
                    =total.toFixed(8)
                  td.hidden-xs
                    =format_unixtime(order.timestamp)
      .footer-padding